#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    YUVSpec spec;

    spec.framerate = 30;
    spec.width  = 1920;
    spec.height = 1080;
    spec.pixelFmt = AV_PIX_FMT_YUV420P;
    spec.yuvPath = "/Users/tgy/Documents/ffmpeg/video/output.yuv";

    player = new YUVPlayer(spec,this);

    player->setGeometry(0,0,spec.width,spec.height);
    on_playBtn_clicked();
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_playBtn_clicked()
{

    player->start();
}

void MainWindow::on_pauseBtn_clicked()
{
    player->pause();

}

void MainWindow::on_stopBtn_clicked()
{

    player->stop();
}
